

package com.iemes.controller.pretest;


import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.iemes.controller.index.BaseController;
import com.iemes.entity.PretestDentsityFormMap;
import com.iemes.entity.PretestHooperFormMap;
import com.iemes.entity.PretestInstructFormMap;
import com.iemes.mapper.pretest.PretesDentsityMapper;
import com.iemes.mapper.pretest.PretesHooperMapper;
import com.iemes.mapper.pretest.PretesInstructMapper;
import com.iemes.plugin.PageView;
import com.iemes.util.Common;


@RequestMapping("/pretest")
@Controller
public class PreorderController extends BaseController {

//	预发指令
	@Inject
	private PretesInstructMapper pretestInstructMapper;
//  密度
	@Inject
	private PretesDentsityMapper pretestDentsityMapper;
//  斗
	@Inject
	private PretesHooperMapper pretesHooperMapper;
	
	@RequestMapping("instruct")
	public String instruct(Model model){
		model.addAttribute("res", findByRes());
		model.addAttribute("dentsity", pretestDentsityMapper.findByWhere(getFormMap(PretestDentsityFormMap.class)));
		model.addAttribute("hooper", pretesHooperMapper.findByWhere(getFormMap(PretestHooperFormMap.class)));
		return Common.BACKGROUND_PATH + "/pretest/preorder/preorder_list";
	}
	
	@ResponseBody
	@RequestMapping("pretest_findByPage")
	public PageView findByPage(String pageNow, String pageSize) throws Exception
	{
		PretestInstructFormMap pretestInstructFormMap = getFormMap(PretestInstructFormMap.class);
		List<Map<String, Object>> pretest = pretestInstructMapper.getAll(pretestInstructFormMap);
		
		LuogicPaging(pageNow, pageSize, pretest);
		pageView.setRecords(pretest);
		return pageView;
	}
	

	
	
}











